package com.example.pharmacypick.service.impl;

import com.example.pharmacypick.mapper.PrescriptionMapper;
import com.example.pharmacypick.pojo.Prescription;
import com.example.pharmacypick.service.PrescriptionService;
import com.example.pharmacypick.vo.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PrescriptionServiceImpl implements PrescriptionService {

    @Autowired
    PrescriptionMapper prescriptionMapper;

    @Override
    public PageInfo<Prescription> findPrescriptionByPatientRecord(int patientRecord) {
        List<Prescription> prescriptionById = prescriptionMapper.findPrescriptionById(patientRecord);

        return new PageInfo<>(prescriptionById);

    }
}
